<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsSpuShopTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('goods_spu_shop')) {
            Schema::create('goods_spu_shop', function (Blueprint $table) {
                $table->increments('id');
                $table->integer('goods_spu_id')->default(0)->comment('属性id');
                $table->integer('shop_id')->default(0)->comment('店铺id');
                $table->decimal('price')->default(0)->comment('商品价格');
                $table->integer('stock')->default(0)->comment('商品库存');
                $table->timestamps();
                $table->softDeletes();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
